package com.mmall.common;

import com.google.common.collect.Sets;

import java.util.Set;

/**
 * @author cg.hu
 * @version 1.0.0
 * @date 2021-09-16 09:25
 * @description
 * @since 1.0.0
 */
public class Const {

    public static final String CURRENT_USER = "currentUser";

    public static final String EMAIL = "email";
    public static final String USERNAME = "username";

    public interface ProductListOrderBy{
        Set<String> PRICE_ASC_DESC = Sets.newHashSet("price_desc", "price_asc");
    }

    public interface Cart{
        // 购物车选中
        int CHECKED = 1;

        // 购物车没有选中
        int UN_CHECKED = 0;

        //库存限制失败
        String LIMIT_NUM_FAIL = "LIMIT_NUM_FAIL";

        //库存限制成功
        String LIMIT_NUM_SUCCESS = "LIMIT_NUM_SUCCESS";
    }

    public interface Role{
        /** 普通用户 */
        int ROLE_CUSTOMER = 0;

        /** 管理员 */
        int ROLE_ADMIN = 1;
    }

    public enum ProductStatusEnum {
        ON_SALE(1, "在线");

        private String value;
        private int code;
        ProductStatusEnum (int code, String value ) {
            this.value = value;
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }
    }

}
